﻿
@model Model.News.E_tb_News
@{
    ViewBag.Title = "NewsList";
}

<!DOCTYPE html>

<head>
    <meta name="viewport" content="width=device-width" />
    <title>首页图片列表</title>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/themes/default/easyui.css")'/>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/themes/icon.css")'/>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/demo.css")'/>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/uploader/uploadify.css")' />
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/Validform/style.css")'  />
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/Validform/style.css")'  />
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Content/XINDECSS/MainStyle.css")'/>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-1.8.2.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-easyui/jquery.easyui.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-easyui/locale/easyui-lang-zh_CN.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/uploader/jquery.uploadify.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/uploader/swfobject.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/MicrosoftAjax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/MicrosoftMvcAjax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/Validform/Validform_v5.3.2_min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/My97DatePicker/WdatePicker.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/kindeditor/kindeditor-min.js")'></script>
    
    @*<script src="../../Scripts/jquery-1.8.2.js" type="text/javascript"></script>*@
    <script type="text/javascript">
        $(document).ready(function () {
            $('#dgtable').datagrid({
                url: "/News/GetList?pageNumber=1&pageSize=8&NewTypeID="+@Model.NewTypeID,
                pagination: true, //分页控件  
                singleSelect: true, //是否单选
                rownumbers: true,
                columns: [[
                    { field: 'NewID', title: '编号', align: 'center' },
                    { 
                        field: 'Title', title: '公告标题', width:'600',align: 'left',
                        formatter: function (value, row, index) {
                            return "<a href='/News/NewsInfo?InfoID="+row.NewID+"'>"+row.Title+"</a>";
                        }
                    },
                    {
                        field: 'NewTypeID', title: '公告类型',width:'140', align: 'center',
                        formatter: function (value, row, index) {
                            return row.NewTypeID == 1 ? "公司动态" : "公告通知";
                        }
                    },
                    { field: 'UpdateTime', title: '更新时间',width:'180', align: 'center' }
                ]],
                onLoadSuccess: function (data) {
                    if (!data.rows) {
                        var body = $(this).data().datagrid.dc.body2;
                        body.find('table tbody').append('<tr><td width="' + body.width() + '" style="height: 25px; text-align: center;">没有数据</td></tr>');
                    }
                }
            });
            var p = $('#dgtable').datagrid('getPager');
            $(p).pagination({
                pageSize: 8, //每页显示的记录条数，默认为10  
                pageList: [8, 10, 15, 20], //可以设置每页记录条数的列表  
                onSelectPage: function (pageNumber, pageSize) {
                    $('#dgtable').datagrid('options').url = "/News/GetList?pageNumber=" + pageNumber + "&pageSize=" + pageSize+"&NewTypeID="+@Model.NewTypeID;
                    $("#dgtable").datagrid("reload");
                }
            });
        });

        //查询
        function click_Search() {
            var txts = $("#txt_Search").val();
            $('#dgtable').datagrid('options').url = "/News/GetList?pageNumber=1&pageSize=8&StrSearch=" + txts+"&NewTypeID="+@Model.NewTypeID;
            $("#dgtable").datagrid("reload");
        }
    </script>
    <style type="text/css">
        .title{width:100%; height:30px; line-height:30px; background:url(/Content/Images_Zhu/Images_53.jpg) repeat-x; margin-top:5px;}
        .title h2{height:30px;line-height:30px; font-size:14px; font-weight:600; text-align:left;padding-left:10px; background:url(/Content/Images_Zhu/images_52.jpg) no-repeat left; width:200px; float:left;}
        .title a{width:40px; height:30px; line-height:30px; display:block; float:right; margin-right:10px; color:Blue;}
    </style>
</head>
<body>
    <!--标题-->
    <div class="title">
        <h2>公告列表</h2>
        <a href="javascript:history.go(-1);">返回</a>
    </div>

    <!--数据列表-->
    <div class="divList">
        <table cellpadding="0" cellspacing="0" width="100%" class="WhereTable">
            <tr>
                <td align="right"style="width:70px;">公告标题：</td>
                <td align="left" style="width:160px;" ><input style="border: 1px solid #3496d6;" width="150px" type="text" id="txt_Search" /></td>
                <td width="67px"><a href="javascript:void(0)" onclick="click_Search()"><img height="20px" src="/Content/Images/chaxun.png" /></a></td>
                <td align="right"></td>
            </tr>
        </table>
        <table cellpadding="0" cellspacing="0" class="biaoge easyui-datagrid" id="dgtable" width="100%">

        </table>
    </div>
</body>
